#include "calServer.hpp"
#include <memory>

using namespace server;

void Usage(const std::string proc)
{
    std::cout<<"\nUsage:\n\t"<<proc<<"port\n"<<std::endl;
}

// ./calserver port
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    uint16_t port = atoi(argv[1]);
    std::unique_ptr<CalServer> csvr(new CalServer(port));

    csvr->initServer();
    csvr->start();

    return 0;
}